<?php
/**
 * @author shuang
 * @date 2016-11-3 13:59:53
 */
$this->title = "进行中的任务";

use yii\helpers\Url;
use yii\helpers\ArrayHelper;
?>
<div class="weui_tab">
    <div class="weui_tab_bd">
        <div class="weui_panel">
            <?php foreach ($data as $item): ?>
                <div class="weui_panel_bd">
                    <div class="weui_media_box weui_media_text">
                        <h4 class="weui_media_title">
                            <a href="javascript:;" class="pull-left"><?php echo ArrayHelper::getValue($item, "title"); ?></a>
                            <?php if (ArrayHelper::getValue($item, "status") > 0): ?>
                                <?php if (ArrayHelper::getValue($item, "single_meet") > 1): ?>
                                    <div class="weui_cell_bd weui_cell_primary pull-right"><a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_primary">账号级别不够</a></div>
                                <?php else: ?>
                                    <div class="weui_cell_bd weui_cell_primary pull-right"><a href="<?php echo Url::toRoute(["work"]); ?>" class="weui_btn weui_btn_mini weui_btn_primary">继续其他任务</a></div>
                                <?php endif; ?>
                            <?php else: ?>
                                <?php if (ArrayHelper::getValue($item, "status") == 0): ?>
                                    <div class="weui_cell_bd weui_cell_primary pull-right"><a href="javascript:window.location.href='<?php echo Url::toRoute(["taskdetail", "taskid" => $item["taskid"], "id" => $item["id"]]) ?>';" class="weui_btn weui_btn_mini weui_btn_primary refreshdetail">继续任务</a></div>
                                <?php else: ?>
                                    <div class="weui_cell_bd weui_cell_primary pull-right"></div>                                   
                                <?php endif; ?>
                            <?php endif; ?>
                        </h4>
                        <ul class="weui_media_info">
                            <li class="weui_media_info_meta">价格：￥<?php echo Yii::$app->formatter->asDecimal($item["brush_price"]); ?></li>
                            <li class="weui_media_info_meta">数量：<?php echo ArrayHelper::getValue($item, "operatecount"); ?></li>
                            <li class="weui_media_info_meta">状态：<?php echo ArrayHelper::getValue(frontendm\models\WB_UserTaskOperate::$status, ArrayHelper::getValue($item, "status")); ?></li>
                            <li class="weui_media_info_meta weui_media_info_meta_extra">可接次数：<?php echo ArrayHelper::getValue($item, "single_meet"); ?></li>
                        </ul>
                    </div>
                </div>
                <div class="clearfix"></div>
            <?php endforeach; ?>
        </div>
        <div class="pagination" style="float:right;">
            <?php
            echo
            \yii\widgets\LinkPager::widget([
                'pagination' => $pager,
                'nextPageLabel' => '下一页',
                'prevPageLabel' => '上一页',
            ]);
            ?>
        </div>
    </div>
</div>